#include "U2GLESPlugin.h"

#include "U2GLESRenderSystem.h"
#include "U2Root.h"



U2EG_NAMESPACE_USING


const U2String sPluginName = "OpenGL ES 1.x RenderSystem";


//---------------------------------------------------------------------
U2GLESPlugin::U2GLESPlugin()
: mRenderSystem(0)
{

}
//---------------------------------------------------------------------
const U2String& U2GLESPlugin::getName() const
{
    return sPluginName;
}
//---------------------------------------------------------------------
void U2GLESPlugin::install()
{
    mRenderSystem = U2_NEW GLESRenderSystem();

    U2Root::getSingleton().addRenderSystem(mRenderSystem);
#if U2_PLATFORM == U2_PLATFORM_APPLE_IOS
    U2Root::getSingleton().setRenderSystem(mRenderSystem);
#endif
}
//---------------------------------------------------------------------
void U2GLESPlugin::initialise()
{
    // nothing to do
}
//---------------------------------------------------------------------
void U2GLESPlugin::shutdown()
{
    // nothing to do
}
//---------------------------------------------------------------------
void U2GLESPlugin::uninstall()
{
    U2_DELETE mRenderSystem;
    mRenderSystem = 0;
}
